

Type TEntityManagerTest Extends TTest

	Field em:TEntityManager' = TEntityManager.GetInstance()
	field e:TEntity

	Method testSetup() {before}
		em = TEntityManager.GetInstance()
	End Method

	Method Constructor() {test}
		AssertNotNull(em._layers, "render layers are not present")
		AssertNotNull(em._entities, "entities list is not present")
	End Method


	Method testAddEntity() {test}
		e = new TEntity
		em.AddEntity(e,2)

		AssertTrue(em._entities.Contains(e), "entity not in main list")
'		AssertEqualsI(2, e.GetRenderLayer(), "entity layer not set to 2")

		AssertNotNull(em._layers.Get(2), "layer 2 not created")
		AssertTrue(TList(em._layers.Get(2)).Contains(e), "entity not in layer 2")
	End Method


	Method testRemoveEntity() {test}
		em.RemoveEntity(e)

		AssertFalse(em._entities.Contains(e), "entity not removed from main list")
		AssertFalse(TList(em._layers.Get(2)).Contains(e), "entity not removed from layer 2")
	End Method

End Type
